<template>
	<view class="u-page">
	<nav-bar title="驾驶员详情"></nav-bar>
		<view class="u-page__item">
			<uni-list>
				<uni-list-item>
					<template v-slot:header>
						<text class="slot-box slot-title">单位名称</text>
					</template>
					<template v-slot:footer>
						<text class="slot-content">{{unitObject.companyname}}</text>
					</template>
				</uni-list-item>
				<uni-list-item>
					<template v-slot:header>
						<text class="slot-box slot-title">驾驶员名称</text>
					</template>
					<template v-slot:footer>
						<text class="slot-content">{{unitObject.drivername}}</text>
					</template>
				</uni-list-item>
				<uni-list-item>
					<template v-slot:header>
						<text class="slot-box slot-title">性别</text>
					</template>
					<template v-slot:footer>
						<text class="slot-content">{{unitObject.sex}}</text>
					</template>
				</uni-list-item>
				<uni-list-item>
					<template v-slot:header>
						<text class="slot-box slot-title">出生年月</text>
					</template>
					<template v-slot:footer>
						<text class="slot-content">{{unitObject.birthday}}</text>
					</template>
				</uni-list-item>
				<uni-list-item>
					<template v-slot:header>
						<text class="slot-box slot-title">民族</text>
					</template>
					<template v-slot:footer>
						<text class="slot-content">{{unitObject.nation}}</text>
					</template>
				</uni-list-item>
				<uni-list-item>
					<template v-slot:header>
						<text class="slot-box slot-title">职称</text>
					</template>
					<template v-slot:footer>
						<text class="slot-content">{{unitObject.duty}}</text>
					</template>
				</uni-list-item>
				<uni-list-item>
					<template v-slot:header>
						<text class="slot-box slot-title">身份证号</text>
					</template>
					<template v-slot:footer>
						<text class="slot-content">{{unitObject.idnumber}}</text>
					</template>
				</uni-list-item>
				<uni-list-item>
					<template v-slot:header>
						<text class="slot-box slot-title">驾驶证号</text>
					</template>
					<template v-slot:footer>
						<text class="slot-content">{{unitObject.drivernumber}}</text>
					</template>
				</uni-list-item><uni-list-item>
					<template v-slot:header>
						<text class="slot-box slot-title">驾驶证审验记录</text>
					</template>
					<template v-slot:footer>
						<text class="slot-content">{{unitObject.driverauditrecord}}</text>
					</template>
				</uni-list-item><uni-list-item>
					<template v-slot:header>
						<text class="slot-box slot-title">年审时间</text>
					</template>
					<template v-slot:footer>
						<text class="slot-content">{{unitObject.iddate}}</text>
					</template>
				</uni-list-item>
				<uni-list-item>
					<template v-slot:header>
						<text class="slot-box slot-title">准驾车型</text>
					</template>
					<template v-slot:footer>
						<text class="slot-content">{{unitObject.drivetype}}</text>
					</template>
				</uni-list-item>
				<uni-list-item>
					<template v-slot:header>
						<text class="slot-box slot-title">技术等级</text>
					</template>
					<template v-slot:footer>
						<text class="slot-content">{{unitObject.techlevel}}</text>
					</template>
				</uni-list-item>
				<uni-list-item>
					<template v-slot:header>
						<text class="slot-box slot-title">政治面貌</text>
					</template>
					<template v-slot:footer>
						<text class="slot-content">{{unitObject.politicalstatus}}</text>
					</template>
				</uni-list-item>
				<uni-list-item>
					<template v-slot:header>
						<text class="slot-box slot-title">学历</text>
					</template>
					<template v-slot:footer>
						<text class="slot-content">{{unitObject.Diploma}}</text>
					</template>
				</uni-list-item>
				<uni-list-item>
					<template v-slot:header>
						<text class="slot-box slot-title">工作关系性质</text>
					</template>
					<template v-slot:footer>
						<text class="slot-content">{{unitObject.jrstate}}</text>
					</template>
				</uni-list-item>
				<uni-list-item>
					<template v-slot:header>
						<text class="slot-box slot-title">工作状态</text>
					</template>
					<template v-slot:footer>
						<text class="slot-content">{{unitObject.workstate}}</text>
					</template>
				</uni-list-item>
				<uni-list-item>
					<template v-slot:header>
						<text class="slot-box slot-title">联系人电话</text>
					</template>
					<template v-slot:footer>
						<text class="slot-content">{{unitObject.drivertel}}</text>
					</template>
				</uni-list-item>
				<uni-list-item>
					<template v-slot:header>
						<text class="slot-box slot-title">录入日期</text>
					</template>
					<template v-slot:footer>
						<text class="slot-content">{{unitObject.created}}</text>
					</template>
				</uni-list-item>
				<uni-list-item>
					<template v-slot:header>
						<text class="slot-box slot-title">健康状况</text>
					</template>
					<template v-slot:footer>
						<text class="slot-content">{{unitObject.healthN}}</text>
					</template>
				</uni-list-item>
				<uni-list-item>
					<template v-slot:header>
						<text class="slot-box slot-title">备注</text>
					</template>
					<template v-slot:footer>
						<text class="slot-content">{{unitObject.remark}}</text>
					</template>
				</uni-list-item>
			</uni-list>
		</view>
	</view>
</template>

<script setup>
	import {
		ref,
		reactive
	} from 'vue'
	import {
		onLoad,
		onShow
	} from '@dcloudio/uni-app'
	import { getDriverDetail } from '@/api/use';
	import NavBar from '@/components/NavBar.vue';
	const unitId = ref('')
	const unitObject = ref({
		
	})
	// 通过事件通道获取单位id
	onLoad((option) => {
		unitId.value = option.id
		serverDriverDetail()
	})
	
	function serverDriverDetail(){
		let params = {
			drid:unitId.value
		}
		getDriverDetail(params).then(res => {
			if(res.code === 1){
				unitObject.value = res.data;
			}else{
				
			}
		})
	}

</script>

<style lang="scss" scoped>
	.u-page {
		padding: 0;

		&__item {
			background-color: #fff;

			&__list {
				display: flex;
				justify-content: space-between;
				margin-bottom: 10px;
				color: #797E84;
				font-size: 13px;

				&__title {
					color: #333;
					font-size: 14px;
				}
			}


			&__title {
				color: #333;
				background-color: #fff;
				padding: 15px;
				font-size: 15px;

				&__slot-title {

					font-size: 14px;
				}
			}

			&__table {
				&__item {
					display: flex;
					justify-content: space-between;
					align-items: center;
					padding: 15px;
					flex: 1;

					&__left {
						color: #797E84;
						font-size: 13px;
					}

					&__right {
						display: flex;
						justify-content: space-around;
						align-items: center;
						color: #333;
						font-size: 14px;

						&__box {
							width: 40px;
							height: 40px;

							text-align: center;

						}
					}
				}
			}
		}
	}

	.u-collapse-content {

		font-size: 14px;
	}
	.slot-content{
		font-size: 16px;
		color: #333;
		float: right;
	}
	.slot-title{
		font-size: 16px;
		color: #999;
	}
</style>